<?php
  
class Message_Model
{

private $id;   
private $fromId;   
private $sendToId;
private $fromName;
private $toWhoName;   
private $data;   
private $timeCreated;   
private $readed;   
private $authorSee;   
private $toWhoSee;
private $isMyMessage;   
  
      
    public function __construct(array $arr = null)
    {  
        if (is_array($arr)){
              $prop = $this->getArray();
              foreach($arr  as $k=>$v){
              if (array_key_exists($k, $prop) == true){
                    $this->$k = $v;
                    }
              }
        }   
    }
    
    public function getId()
    {
        return $this->id;
    }
    
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }
    
    public function getFromId()
    {
        return $this->fromId;
    }
    
    public function setFromId($fromId)
    {
        $this->fromId = $fromId;
        return $this;
    }
    
    public function getSendToId()
    {
        return $this->sendToId;
    }
    
    public function setSendToId($sendToId)
    {
        $this->sendToId = $sendToId;
        return $this;
    }
    
    public function getFromName()
    {
        return $this->fromName;
    }
    
    public function setFromName($fromName)
    {
        $this->fromName = $fromName;
        return $this;
    }
    
    public function getToWhoName()
    {
        return $this->toWhoName;
    }
    
    public function setToWhoName($toWhoName)
    {
        $this->toWhoName = $toWhoName;
        return $this;
    }
    public function getIsMyMessage()
    {
       return $this->isMyMessage;
    }
    
    public function setIsMyMessage($isMyMessage)
    {
        $this->isMyMessage = $isMyMessage;
        return $this;
    }
    
    public function getData()
    {
        return $this->data;
    }
    
    public function setData($data)
    {
        $this->data = $data;
        return $this;
    }
    
    public function getTimeCreated()
    {
        return $this->timeCreated;
    }
    
    public function setTimeCreated($timeCreated)
    {
        $this->timeCreated = $timeCreated;
        return $this;
    }
    
    public function getReaded()
    {
        return $this->readed;
    }
    
    public function setReaded($readed)
    {
        $this->readed = $readed;
        return $this;
    }
    
    public function getAuthorSee()
    {
        return $this->AuthorSee;
    }
    
    public function setAuthorSee($authorSee)
    {
        $this->authorSee = $authorSee;
        return $this;
    }
    
    public function getToWhoSee()
    {
        return $this->toWhoSee;
    }
    
    public function setToWhoSee($toWhoSee)
    {
        $this->toWhoSee = $toWhoSee;
        return $this;
    }
    
    public function getArray()
    {
        $objArr = get_object_vars($this);
        return $objArr;
    }  
    

    
}